package com.linked.basemanage.statistics.controller;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.linked.basemanage.feign.Bean.UserCountMonthDTO;
import com.linked.basemanage.feign.Bean.UserRelatedTotalDTO;
import com.linked.basemanage.feign.IUserManageFeign;
import com.linked.basemanage.statistics.bean.dto.UserStatisticsDTO;
import com.linked.universal.common.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;
import java.util.List;

/**
 * @author :dbq
 * @date : 2023/1/16 13:10
 * @description : desc
 */
@Slf4j
@RestController
@RequestMapping("userstatistics")
public class UserStatisticsController {

//    private final IUserManageFeign userManageFeign;
//
//    private final ObjectMapper mapper;
//
//    @Autowired
//    public UserStatisticsController(IUserManageFeign userManageFeign, ObjectMapper mapper) {
//        this.userManageFeign = userManageFeign;
//        this.mapper = mapper;
//    }
//
//    @PostMapping("queryUserStatistics")
//    Result queryUserStatistics() throws Exception {
//        UserStatisticsDTO res = new UserStatisticsDTO();
////        Result temp1 = userManageFeign.queryUserRelatedTotal();
////
////        if (Boolean.valueOf((Boolean) temp1.get("success"))) {
////            res.setUserRelatedTotal((UserRelatedTotalDTO) temp1.get("data"));
////        }
//        Result temp2 = userManageFeign.queryNewUserCountYear(LocalDate.now().getYear() + "");
//        if (Boolean.valueOf((Boolean) temp2.get("success"))) {
//            res.setNewUserCountYear((List<UserCountMonthDTO>) temp2.get("data"));
//        }
//        Result temp3 = userManageFeign.queryUserLoginCountYear(LocalDate.now().getYear() + "");
//        if (Boolean.valueOf((Boolean) temp3.get("success"))) {
//            res.setUserLoginCountYear((List<UserCountMonthDTO>) temp3.get("data"));
//        }
//        return Result.success(res);
//    }
}
